package com.java2018.springmvc.book.model;



import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;

//@Component("book")

//@JsonIgnoreProperties(ignoreUnknown = true,value = {"name","author_id"})


public class Book{
//    private static final long serialVersionUID = -6593142397632219716L;

//    @Value("${name}")
    private String name; //书名

//    @JsonIgnore

    private String id; //书id
    @JSONField(name = "author_id")
    private String authorId; //作者id
    private String typeId; //类型id
    private String publishName; //发布商名字
    private Date createTime; //创建时间

    private Date updateTime; //更新时间

    private BigDecimal price; //价格
    private String authorName; //作者名字
    private String typeName; //类型名字


    private Author author; //作者
    private BookType bookType; //书的类型
    public Author getAuthor() {
        return author;
    }
//    @Autowired
//    @Qualifier("author2")

//    @Value("#{1==1?author:author2}")
    public void setAuthor(Author author) {
        this.author = author;
    }

    public BookType getBookType() {
        return bookType;
    }

    public void setBookType(BookType bookType) {
        this.bookType = bookType;
    }


    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }


    public String getName() {
        return name;
    }

//    @Value("小叮当")
    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAuthorId() {
        return authorId;
    }

    public void setAuthorId(String authorId) {
        this.authorId = authorId;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String getPublishName() {
        return publishName;
    }

    public void setPublishName(String publishName) {
        this.publishName = publishName;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", id='" + id + '\'' +
                ", authorId='" + authorId + '\'' +
                ", typeId='" + typeId + '\'' +
                ", publishName='" + publishName + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", price=" + price +
                ", authorName='" + authorName + '\'' +
                ", typeName='" + typeName + '\'' +
                ", author=" + author +
                ", bookType=" + bookType +
                '}';
    }
}
